home *** CD-ROM | disk | FTP | other *** search
/ PD ROM 1 / PD ROM Volume I - Macintosh Software from BMUG (1988).iso / Programming / Complete Applications / Othello C Source / getmove.c < prev    next >
Encoding:
C/C++ Source or Header  |  1985-06-16  |  416 b   |  24 lines  |  [TEXT/ttxt]

  1. /* getmove.c - GetMove */
  2.  
  3. #include "mac/quickdraw.h"
  4. #include "mac/osintf.h"
  5. #include "mac/toolintf.h"
  6. #include "othello.h"
  7.  
  8.  
  9.  
  10. GetMove(where, move)
  11. Point    *where;
  12. MoveRecord    *move;
  13. {
  14.     int    row, col;
  15.  
  16.     row = where->v - SCALE/2;
  17.     col = where->h - SCALE/2;
  18.     if (row < 0 || col < 0)
  19.         return(FALSE);
  20.     move->row = row / SCALE + 1;
  21.     move->col = col / SCALE + 1;
  22.     return(move->row <= BOARDSIZE && move->col <= BOARDSIZE);
  23. }
  24.